<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>KCMS</title>
<jsp:include page="../iframecommon.jsp"></jsp:include>
<script type="text/javascript">
function myCheck(){
	var inputs = document.getElementsByName('chapter');
	var count = 0;
	var count2=0;
	  for (var i = 0, l = inputs.length; i < l; i++) {
			count2++;
	      if (inputs[i].value!="") {
	          count++;
	      }
	  }
	  if (count2!=count) {
		alert('请确保所有章节名均不为空');
	  	return false;
	  	}
	  
	  
	  inputs = document.getElementsByName('description');
		count = 0;
		count2=0;
		  for (var i = 0, l = inputs.length; i < l; i++) {
				count2++;
		      if (inputs[i].value!="") {
		          count++;
		      }
		  }
		  if (count2!=count) {
			alert('请确保所有描述均不为空');
		  	return false;
		  	}
		  
		  
		  
		  inputs = document.getElementsByName('doc');
			count = 0;
			count2=0;
			
			  for (var i = 0, l = inputs.length; i < l; i++) {
					count2++;
			      if (inputs[i].value!="") {
			    	  
			          count++;
			      }
			  }
			  if (count2!=count) {
				alert('请确保每个课件均已选择上传');
			  	return false;
			  	}
	return true;
}
</script>
</head>
<body>

<div class="col-lg-12">
<div class="main-box">

<header class="main-box-header clearfix">
<h1>课件上传</h1>
</header>
<div class="alert alert-success">
<i class="fa fa-check-circle fa-fw fa-lg"></i>
请逐个填写空格，对同一课程号课序号且章节名相同的课件将视为同一个资源并覆盖存储
</div>





<form action="ppt_upload" method="POST" enctype="multipart/form-data" onsubmit="return myCheck()">
<div class="alert alert-info">
<i class="fa fa-check-circle fa-fw fa-lg"></i>
请填写信息

<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th><span>课程号</span></th>
<th><span>课序号</span></th>
<th><span>课程名</span></th>
<th><span>课程描述</span></th>
<th><span>学分</span></th>
<th><span>课程属性</span></th>
<th><span>周次</span></th>
<th><span>时间</span></th>
<th><span>上课地点</span></th>
<th><span>文件上传</span></th>
<th><span>章节名</span></th>
<th><span>课件描述</span></th>
</tr>
</thead>
<tbody>
<s:iterator value="cr2" status="cid">
   <tr>
      <td><input class="form-control" readonly="true" name="cid" value="<s:property value="cid" />"></td>
      <td><input class="form-control" readonly="true" name="csn" value="<s:property value="csn" />"></td>
      <td><s:property value="cname" /></td>
	  <td><s:property value="description" /></td>
      <td><s:property value="xuefen" /></td>
      <td><s:property value="properties" /></td>
      <td><s:property value="week" /></td>
      <td><s:property value="time" /></td>
      <td><s:property value="location" /></td>
      <td><input class="form-control" type="file" id="docfuck" name="doc"/></td>
      <td><input class="form-control" type="text" name="chapter" /></td>
      <td><input class="form-control" type="text" name="description" /></td>
   </tr>
</s:iterator>
</tbody>
</table>
<input type="submit" class="btn btn-success" value="上传"/>
<input type="reset" class="btn btn-default" value="重置"/>
</div></div>
</form>
</div></div>


</body>
</html>